/*
 * File     : LargeParameter64.java
 * Created  : 1 May 2011
 *
 * Copyright © 2011 Matthew Wilson (mj. {my-surname} .uk {at} gmail.com)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.googlecode.dni.internal.call;

import java.util.List;

import org.objectweb.asm.MethodVisitor;


/**
 * Special parameter implementation for passing parameters through a buffer.
 * Used when the number of parameters exceeds a limit.  All parameters are
 * passed as 64-bit.
 *
 * @author Matthew Wilson
 */
final class LargeParameter64 extends AbstractLargeParameter
{

    private final int words;

    /**
     * @param parameters
     *            the parameters to send
     */
    LargeParameter64( final List< Parameter > parameters )
    {
        super( parameters );

        this.words = parameters.size();

        setNativeTypeAsPointer();
        assert getNativeType() == 'J';
    }

    /**
     * @return the number of 64-bit words used
     */
    @Override
    int getWords()
    {
        return this.words;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    void writePrepareParameter( final MethodVisitor methodVisitor )
    {
        // TODO v1.1 large parameter support
        throw new UnsupportedOperationException( "FIXME" );
    }

}
